<%--
  Created by IntelliJ IDEA.
  User: lb
  Date: 15-12-10
  Time: 下午2:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>


<html>
<head>
    <title>漫庭网-修改密码</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <link href="/public/css/loginAndRegister.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<div id="resetting" class="resetting">
    <form:form commandName="passwordHandelDTO" autocomplete="off">
        <div class="registerIn">
            <img src="/public/img/bn/logo.png" width="212" height="63">
            <div class="username clearfix resetting">
                <p>请修改您的密码</p>
            </div>
            <div class="username clearfix">
                <ul>
                    <li>
                        <form:input  path="userName" maxlength="11" placeholder="手机号码" cssClass="signText t08" id="userName" readonly="true"/>
                        <form:errors path="userName" cssClass="t16"/>
                        <span><i class="updatePsw telIcon"></i></span>
                    </li>
                    <li>
                        <form:password path="password" maxlength="6" placeholder="原密码" cssClass="spText t08" id="password"/>
                        <form:errors path="password" cssClass="t16" id="oldpassword"/>
                        <span class="error" id="oldpassworderror"><img src="/public/img/errorImage.png" alt=""></span>
                        <span><i class="updatePsw validationIcon"></i></span>

                    </li>
                </ul>
            </div>
            <div class="username clearfix">
                <ul>
                    <li>
                        <form:password path="newPassword" maxlength="6" placeholder="新密码" cssClass="spText t08" id="newPassword"/>
                        <form:errors path="newPassword" cssClass="t16"/>
                        <span class="error"><img src="/public/img/errorImage.png" alt=""></span>
                        <span><i class="updatePsw newPswIcon"></i></span>
                    </li>
                    <li>
                        <form:password path="reNewPassword" maxlength="6" placeholder="确认新密码" cssClass="spText t08" id="reNewPassword"/>
                        <form:errors path="reNewPassword" cssClass="t16"/>
                        <span class="error"><img src="/public/img/errorImage.png" alt=""></span>
                        <span><i class="updatePsw rePawIcon"></i></span>
                    </li>
                </ul>
            </div>
            <input type="submit" class="registerBtn" value="确认修改"/>
        </div>
    </form:form>
</div>
<script src="/public/js/jquery-1.7.2.min.js"></script>
<script>

    if ($("#oldpassword").length > 0) {
        $("#oldpassworderror").show()
    }
    else {
        $("#oldpassworderror").hide()
    }

    $(".spText").on('blur', function () {
        if($(this).val().length!=6){
            $(this).next(".error").show()
            $(".registerBtn").prop({disabled:"disabled"})
        }else{
            $(this).next(".error").hide()
            $(".registerBtn").removeAttr("disabled")
        }
    })
    $("#reNewPassword").on('blur', function () {
        var newPassword=$("#newPassword").val();
        var reNewPassword =$("#reNewPassword").val();
        console.log(reNewPassword!=newPassword)
        if(reNewPassword!=newPassword){
            $("#reNewPassword").next(".error").show()
            $(".registerBtn").prop({disabled:"disabled"})
        }else{
            $("#reNewPassword").next(".error").hide()
            $(".registerBtn").removeAttr("disabled")
        }
    })
</script>
</body>
</html>
